from utils.logger_util import Logger

import requests

host = "http://127.0.0.1:10010/"

class Request():
    log = Logger.getlog()

    def get(self,url,**kwargs):
        self.log.info('准备开始发起get请求,url:'+url)
        self.log.info('接口信息是: {}'.format(kwargs))
        r = requests.get(url,**kwargs)
        self.log.info('接口响应状态码: {}'.format(r.status_code))
        self.log.info('接口响应内容是: {}'.format(r.text))
        return r

    def post(self,url,**kwargs):
        self.log.info('准备开始发起post请求,url:'+url)
        self.log.info('接口信息是: {}'.format(kwargs))
        r = requests.post(url,**kwargs)
        self.log.info('接口响应状态码: {}'.format(r.status_code))
        self.log.info('接口响应内容是: {}'.format(r.text))
        return r

